export default function (context) {
  console.log(process.server);
  console.log(context.req.headers['user-agent']);
  const userAgent = process.server ? context.req.headers['user-agent'] : navigator.userAgent

  // eslint-disable-next-line prefer-regex-literals
  const re = new RegExp('MSIE ([0-9]{1,}[.0-9]{0,})');
  
  if (re.exec(userAgent) != null) {
    const rv = parseFloat(RegExp.$1);

    if (rv < 9) { // 低于IE9以下  跳转 提示浏览器升级 页面
      return context.redirect('https://support.dmeng.net/upgrade-your-browser.html')
    }
  }
  // console.log(userAgent);
}
